package com.fzl.springblogdemo.pojo.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

@Data
public class BlogInfoResponse {
    private Integer id;
    private String title;
    private String content;
    private Integer userId;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime createTime;

//    public String getContent() {
//        //截断content内容，重写get方法即可
//        //subtring方法可以规定截断长度
//        return content==null?"":content.substring(0,50);
//    }
}
